package com.base2.webshop.server.dao;

import java.util.List;

import com.base2.webshop.server.entities.Product;

public class ProductDao extends AbstractDao {

	public ProductDao() {
	}

	@SuppressWarnings("unchecked")
	public List<Product> findAllProducts() {
		return jpaTemplate.find("from Product");
	}

	public Product findProduct(Long id) {
		return jpaTemplate.find(Product.class,id);
	}
	
	public void persist(){
		jpaTemplate.persist(this);
	}
	
	public void remove(){
		jpaTemplate.remove(this);
	}
}
